import React from 'react';
import { PageContainer } from '@ant-design/pro-layout';
import { Card } from 'antd';
import BreadcrumbDept from '@/components/BreadcrumbDept';
import { useModel } from 'umi';
import { isNull } from '@/utils/utils';

export default (props): React.ReactNode => {
  const { initialState } = useModel('@@initialState');
  const { menus } = initialState;
  const { nopermission } = props.location.query;

  return (
    <PageContainer extra={<BreadcrumbDept />}>
      {
        <Card style={{ minHeight: 'calc(100vh - 64px)', textAlign: 'center' }}>
          <img style={{ marginTop: 40 }} src={require('../../assets/images/welcome.png')} />
          <div style={{ marginTop: 20, color: '#2E8DE6' }}>
            {menus?.length === 0 && ((initialState.currentUser || {}).identity_type === 'P' || isNull((initialState.currentUser || {}).identity_type)) ? '系统检测您为首次登录，请联系管理员开通权限' : !nopermission ? '欢迎使用生活缴费营销系统，请点击左侧菜单进行操作！' : '您尚未获得此功能权限，请联系管理员获取'}</div>
        </Card>
      }
    </PageContainer>
  );
};
